-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SBA School Management System #13
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
private String password; | ||
|
||
@OneToMany() | ||
@JoinTable(name = "student-course", joinColumns = {@JoinColumn(name = "email")}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 🔥
return null; | ||
} | ||
|
||
@Override | ||
public Boolean validateStudent(String studentEmail, String password) { | ||
return null; | ||
Boolean isValid= getAllStudents().stream() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider
password.equals(Objects.requireNonNull(getStudentByEmail(studentEmail)).getPassword());
.filter(courseInterface -> courseInterface.getId().equals(courseId)) | ||
.findFirst().get(); | ||
|
||
student.getCourses().add(addCourse); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this appears to be adding the course to the ArrayList
returned by getCourses()
.
Can you verify that this is persisting the course registry of the Student
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, Leon. Yes, it was not persisting in the database. I changed the code.
|
||
// when | ||
// TODO - define `when` clause | ||
|
||
String expected= service.getStudentByEmail(email).getEmail(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// when
Student actual = service.getStudentByEmail(email);
public void test() { | ||
JdbcConfigurator.initialize(); | ||
StudentDao service = (StudentDao) new StudentService(); | ||
String email="[email protected]"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// given
String expectedEmail = "[email protected]";
String expectedName = ...;
Long expectedId = ...;
Student expectedStudent = new Student(expectedId, expectedEmail, expectedName);
Completed